The present invention pertains to an apparatus and method for configuring a spanning tree. In particular, the present invention relates to an apparatus and method for configuring a spanning tree and a spanning tree protocol system and bridge system employing a spanning tree protocol and a bridge comprising the protocol that can correspond to a logical LAN employing a switching HUB, irrelevant to a physical position (network configuration), a VLAN (Virtual LAN) which can be segmented by mixing a physical mode (for example, Ethernet or ATM-LAN) or communication protocols (for example, TCP/IP or NetWare).
In a network containing a redundant route caused by a plurality of bridges, a spanning tree protocol is used for determining a route.
For example, as shown in FIG. 7, assume a network over which LAN 1 and LAN 2 are connected to each other by means of a bridge A.
Here, in the case where of a network over which node “n1” such as personal computer is connected to LAN 1, and further, HUB 1 is connected to LAN 2, packets transmitted from the node “n1” are transmitted to all nodes of a broadcast domain including node “n2” such as personal computer connected to the HUB 1 via LAN 1→bridge A→LAN 2→HUB 1.
Over such network, when HUB 2 is connected to LAN 1 and LAN 2 in parallel to bridge A, a packet transmitted from the node “n1” loops over the network like LAN 1→bridge A→LAN 2→HUB 2→LAN 1→bridge A→LAN 2→HUB 2. As a result, a packet cannot be transmitted from a node other than node “n1” (node in a broadcast domain other than node “n1”).
In the case where a network is configured by only bridge A and HUB 1 as shown in FIG. 7, a spanning tree is employed to prevent a packet transmitted from a node from looping over the network.
In addition, as shown in FIG. 8, in the case where two bridges A and B are connected in parallel between LAN 1 to which node “n1” such as personal computer is connected and LAN 2 to which HUB 1 is connected, thereby making communication among nodes “n2”, “n3”, “n4”, . . . such as personal computers connected to node “n1” and HUB 1, one bridge A is generally used to make communication. When this bridge A is linked down, the other bridge B is used to make communication, whereby a spanning tree is employed in order to cause a network to provide redundancy.
Here, basic algorithm and protocol of the spanning tree consists of the following items (1) to (5) (Refer to ISO/IEC 15802-3: 1998 (E) ANSI/IEEE Std 802. 1D, 1998 Edition, LOCAL AND METROPOLITAN AREA NETWORKS: MEDIA ACCESS CONTROL (MAC) BRIDGES, pp. 58–75, 8. the Spanning Tree Algorithm and Protocol).
(1) A special frame called Configuration Bridge Protocol Data Units (hereinafter, referred to as BPDU) is exchanged between bridges.
The following works are performed based on this exchanged BPDU.
(2) A network root bridge is selected.
Only one root bridge exists in the entire LAN bridge connected.
(3) Each bridge computes the shortest route that reaches a root bridge (A port that provides the shortest route to the root bridge is called a root port).
(4) With respect to each LAN, a “designated bridge” is selected from a bridge connected to such each LAN.
(5) Each bridge selects a port (designated port) that belongs to a spanning tree and a port (blocked port) that does not belong to such spanning tree.
All data frames received at a blocked port are discarded.
In addition, frame transmission from a blocked port is not performed at all.
A received BPDU is not forwarded at all.
A data portion of the above mentioned BPDU includes at least root ID, bridge ID, and root path cost.
Root ID is an ID of a root bridge (or a bridge assumed to be such root bridge), and is generated based on a MAC address of such bridge and a priority designated by an administrator.
Bridge ID is an ID of a bridge that transmits a BPDU, and is generated based on a MAC address of such bridge and a priority designated by an administrator.
A root path cost is a cost of the (possible) shortest route from a bridge that transmits a BPDU to a root bridge.
In an initial state (when a power is supplied), each bridge is a root bridge itself, and it is assumed that a root path cost is 0.
Each bridge transmits the initial value of a BPDU to all ports, and at the same time, receives the BPDU transmitted from another bridge from all the ports.
In the case where a bridge has received a better BPDU from a port, such bridge stops transmission of BPDU to that port, and then, changes the value of the BPDU to be transmitted by the bridge itself.
In this manner, in the case where a spanning tree enters a stable state, only one bridge transmits a BPDU among each LAN.
For example, in the case where BPDU 1 and BPDU 2 are present, it is judged which of the above two BPDUs is better in accordance with rules (1) to (4) below.
(1) In the case where root ID of BPDU 1 is numerically smaller than that of BPDU 2, it is judged that BPDU 1 is better than BPDU 2.
(2) In the case where root ID of BPDU 1 is numerically equal to that of BPDU 2, if a root path cost of BPDU 1 is smaller than that of BPDU 2, it is judged that BPDU 1 is better than BPDU 2.
(3) In the case where root ID of BPDU 1 is numerically equal to that of BPDU 2, and a root path cost of BPDU 1 is equal to that of BPDU 2, if bridge ID of BPDU 1 is numerically smaller than that of BPDU 2, it is judged that BPDU 1 is better than BPDU 2.
(4) In the case where root ID of BPDU 1 numerically equal to that of BPDU 2, a root path cost of BPDU 1 is equal to that of BPDU 2, and bridge ID of BPDU 1 is numerically equal to that of BPDU 2, if port ID of BPDU 1 is smaller than that of BPDU 2, it is judged that BPDU 1 is better than BPDU 2.
Then, each bridge compares the initial value of its own BPDU with that of the BPDU from another bridge received from all ports, and selects root ID from the best BPDU.
Next, each bridge computes its own root path cost in accordance with (root path cost)=(root path cost in the best BPDU)+path cost.
A path cost is a cost to the root that each port individually has, and the value of the cost can be set by an administrator.
Once a root ID, a route port, and a root path cost are defined, each bridge updates the content of BPDU transmitted by such each bridge itself.
Further, its own updated BPDU is compared with BPDU received from a port other than root port, and it is judged whether or not each port other than root port is a designated bridge itself.
A port that is a designated bridge is called a designated port, and a port that is not a designated bridge is called a blocked port.
In BPDU transmission and data frame forwarding to a root port, a designated port and a blocked port, a data frame is forwarded at the root port without transmitting BPDU; BPDU is transmitted, and a data frame is forwarded at the designated port; and BPDU is not transmitted, and a data frame is not forwarded at the blocked port.
In this manner, once a spanning tree is configured, each bridge performs regular operations described in (1) to (4) below.
These regular operations are required for reconfiguring a spanning tree that has been configured due to a bridge fault or addition of new bridge.
(1) BPDU includes an element called “message age”.
This value denotes an elapsed time after a root bridge has generated a BPDU that corresponds to the above BPDU.
(2) A root bridge transmits its own BPDU periodically to all ports. At this time, “message age” is set to 0.
(3) Each bridge stores a received BPDU, and increases the value of the “message age” of the BPDU stored in each port with an elapse of time (message age timer).
(4) A bridge other than root bridge transmits its own BPDU when it receives a BPDU from a root port.
At this time, as a value of the “message age”, there is used a value equal to or greater than the “message age” of the root port and greater than the “message age” of the received BPDU.
Here, the reconfiguration of the spanning tree occurs in any of the cases described in (1) and (2) below.
(1) In the case where the “message age” timer of the stored BPDU times out (in the case where a max age is exceeded); or
(2) In the case where a BUDU better than that stored in a port or a BPDU with the small value of the message age is received from the same port.
In the case where any of the above events occurs, a bridge performs re-computation for a root ID, a root cost, and a root port.
In the meantime, it is very dangerous to perform data frame transmission before all the bridges over a network enters a normal state after configuration (reconfiguration) of a spanning tree has been started.
This is because there is a possibility that a temporary loop occurs during spanning tree configuration.
Therefore, even if each bridge determines its own designated port, it does not start data frame forwarding immediately.
There are three types of the states of each port in a bridge:
(1) listening: No work concerning a data frame is carried out.
(2) learning: Although the learning of a starting MAC address is performed, forwarding is not performed.
(3) forwarding: Data frame forwarding is performed.
The lengths of the listening state and learning state are called a “forward delay”. A root bridge determines its value, enters its value in a BPDU, and transmits the fact to each bridge.
In addition, a timer employed in the listening state and learning state is called a “forwarding timer”.
If spanning tree reconfiguration occurs, a host position changes, and the contents of an old learning table may be incorrect.
Thus, the bridge corresponding to a spanning tree has the following two kinds of states as timeout values of the learning table aging timer.
(1) Normal value: This value is set to a long time such as a few minutes.
(2) A value used after topology change: This value is the same as the forward delay value.
When a bridge senses spanning tree reconfiguration, the timeout value of the learning table aging timer is set to a value identical to forward delay for a predetermined period of time.
In the meantime, a spanning tree algorithm and protocol have a system that notifies to all bridges that spanning tree reconfiguration has occurred as in (1) to (5) below.
(1) When a bridge senses a topology change, that bridge transmits a frame called TCN-BPDU (Topology Change Notification BPDU) to a root port with hello time intervals.
This transmission is continued until a BPDU in which a TCA (Topology Change Acknowledgment) flag is set has been received from the root port.
(2) A bridge which has received TCN-BPDU also transmits TCN-BPDU to its own root port.
On the other hand, to a port that receives a TCN-BPDU, a BPDU TCA flag is set, and a BPDU is transmitted during transmission of the next BPDU.
(3) In the case where a root bridge receives a TCN-BPDU or the state of its own port changes, the root bridge transmits a BPDU in which a TC (Topology Change) flag is set from that time to a max age+forward delay time.
(4) A bridge which has received the TC flag set BPDU from a root port sets a TC flag for its own BPDU, and transmits such BPDU.
This transmission is continued until a BPDU in which a TC flag is not set has been received.
(5) While a bridge receives TC flag set BPDU from the root port, the bridge uses the value of “forward delay” as a timeout value of the learning table aging timer.
In this way, a spanning tree has an algorithm for automatically removing a loop in a redundant bridge network, and automatically sensing a network topology change caused by a device fault or cable failure, thereby automatically changing a network topology so as to prevent a loop from being produced.
In the meantime, there has been a problem that a spanning tree protocol specified under the above described IEEE Std 802. 1D does not correspond to a VLAN.
This is because a spanning tree configures a tree structure irrelevant to a VLAN topology.
In more detail, for example, as shown in FIG. 9, in the case where VLAN 1 and VLAN 2 are mixed in bridge A and bridge B to configure a network, when a spanning tree protocol specified under the above described IEEE std 802. ID is employed, such network is regarded as one loop. Thus, a spanning tree cannot be constructed for each VLAN, and a place that should not be essentially blocked (VLAN 1 in FIG. 1, for example) is blocked.
As a result, there has been a problem that data communication at such blocked place becomes impossible.
In the meantime, in VLAN Trunk Port specified under IEEE Std 802. IQ (refer to IEEE std 802. 1Q-1998 LOCAL AND METROPOLITAN AREA NETWORKS: VIRTUAL BRIDGES LOCAL AREA NETWORKS, pp. 62–69, 9. Tagged frame format), a plurality of VLANs exist at the same port.
Thus, there has been a problem that BPDUs must be transmitted and received by the number of VLANs, and a load on the incorporated CPU is increased, thus requiring a long processing time and causing lowered communication efficiency.